package com.markul.android.ui.main.mainFragment

import android.content.Intent
import androidx.lifecycle.ViewModelProvider
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.markul.android.R
import com.markul.android.ui.detail.DetailedActivity
import com.markul.android.ui.mark.MarkActivity
import com.markul.android.ui.shared.SharedActivity
import kotlinx.android.synthetic.main.our_main_fragment.*

class OurMainFragment : Fragment() {

    companion object {
        fun newInstance() = OurMainFragment()
    }

    private lateinit var viewModel: OurMainViewModel

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.our_main_fragment, container, false)
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        viewModel = ViewModelProvider(this).get(OurMainViewModel::class.java)
        ourMarkBtn.setOnClickListener {
            val intent = Intent(context, MarkActivity::class.java)
            intent.putExtra("who","our")
            startActivity(intent)
        }

        sharedAlbumBtn.setOnClickListener {
            val intent=Intent(context, SharedActivity::class.java)
            startActivity(intent)
        }
        groupMemberBtn.setOnClickListener{
//           val intent=Intent(context, DetailedActivity::class.java)
//            startActivity(intent)
        }
    }
}